#include "API.h"

#include <math.h>

double accurateResultAt(double x, double t)  {
#ifdef Markov
	return Constant::a * t + Constant::B + log(Constant::A * x + Constant::C); 
#endif // Markov
#ifdef Sherenk
	return pow(Constant::e, Constant::b * t) * pow((Constant::A * x + Constant::B),(double)(3.0/5.0)); 
#endif // Sherenk
#ifdef Iskandar
	return pow(Constant::e, Constant::b * t) * pow((Constant::A * x + Constant::B), -1);
#endif // Iskandar
}

void calculateAccurateSolution (Matrix &matrix) {
//#pragma omp parallel for
	for (int k = 0; k < Constant::T_GRID_SIZE; ++k)
		for (int i = 0; i < Constant::X_GRID_SIZE; ++i)
			matrix.set(k, i, accurateResultAt(Constant::X_LOWER_BOUND + i * Constant::H, Constant::T_LOWER_BOUND + k * Constant::TAU));
}
